#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <thread.h>
#include <QDebug>
MainWindow::MainWindow(QMainWindow *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
    //, thread(parent)
{
    ui->setupUi(this);

    //connect(&thread,&Thread::notify,this,&MainWindow::handle);
    //thread.start();

    Thread t1(this);
    Thread t2(this);

    t1.start();
    t2.start();

    t1.wait();
    t2.wait();

    qDebug()<<Thread::num;

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::handle()
{
    int value = ui->lcdNumber->value();
    value--;
    ui->lcdNumber->display(value);
}

